package com.sample.demo.action;



import java.io.IOException;
import java.io.OutputStream;

import com.webkit.web.MultiPartFile;

public class FileAction extends AbstractStreamAction{
	
	private MultiPartFile file;

	public void execute(OutputStream output) {
		
		try {
			System.out.println(file);
			
			System.out.println(file.getBytes().length);
			if(file != null){
				output.write(file.getFileName().getBytes());
			}else{
				output.write("file upload failed".getBytes());
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public MultiPartFile getFile() {
		return file;
	}

	public void setFile(MultiPartFile file) {
		this.file = file;
	}
	
	
}
